-----------------------------------------------------------------------------
--
-- Module      :  Main
-- Copyright   :
-- License     :  AllRightsReserved
--
-- Maintainer  :
-- Stability   :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------

module Main (main) where

import Database.HaskellDB
import Database.HaskellDB.HDBC.ODBC

import Main.Table1 as Table1

testDbConnectionOptions =
	[ ("Driver", "{SQL Server Native Client 10.0}")
	, ("Server", ".\\SQLExpress")
	, ("Database", "Test")
	, ("Trusted_Connection", "yes")
	]

withTestDb = connect driver testDbConnectionOptions

query1 =
    do  a <- table table1
        project (Table1.id << a!Table1.id)

test1 testDb =
    do  let a = showSql query1
        putStrLn a
        res <-  query testDb query1
        return res

main = do
    withTestDb test1
